import React,{Component}from "react"
export default function Art(WrappedComponent:React.ComponentClass){
    //这是一个高阶组件
    interface props {
        child:JSX.Element,
        name:String
     }
    return class PP extends Component<props>{
        constructor(props:props){
            console.log(props,"reactHoc 代理");
            super(props);
            //劫持props 并修改
            props.name="fanjiantao2"
           
        }
        render(){
            return <WrappedComponent {...this.props}></WrappedComponent>
        }
    }
}

